package com.flyduck.system.vo.post.trans;


import cn.hutool.core.bean.BeanUtil;
import com.flyduck.system.entity.SysPostEntity;
import com.flyduck.system.vo.post.SysPostAddReqVO;
import com.google.common.base.Function;


/**
 * @program: flyduck-platform
 * @description:
 * @author: flyduck
 * @create: 2021-02-01 12:42
 **/
public class SysPostAddReqVOToSysPostEntity implements Function<SysPostAddReqVO, SysPostEntity> {

    @Override
    public SysPostEntity apply(SysPostAddReqVO sysPostAddReqVO) {
        SysPostEntity sysPostEntity = new SysPostEntity();
        BeanUtil.copyProperties(sysPostAddReqVO,sysPostEntity);
        sysPostEntity.setSort(Integer.valueOf(sysPostAddReqVO.getSort()));
        return sysPostEntity;
    }
}
